<% content_for(:page_title, '卡bin管理') %>
<div class="modal" id="search_form_modal" role="dialog" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">
                    <span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                <h4 class="modal-title" id="myModalLabel">输入查询条件</h4>
            </div>
            <div class="modal-body">
                <%= render 'search_form' %>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                <a type="button" class="btn btn-danger" href="<%= bank_card_bins_path %>"><i class="fa fa-exclamation-circle"></i>
                    重置查询</a>
                <button type="submit" class="btn btn-primary"><i class="fa fa-fighter-jet"></i> 执行查询</button>
            </div>
        </div>
    </div>
</div>
<!-- /.row -->
<div class="row">
    <div class="col-lg-12">
        <div class="panel panel-default">
            <div class="panel-heading">
                <% if can? :create, Bank::CardBin %>
                    <a type="button" class="btn btn-success" href="<%= new_bank_card_bin_path %>"><i class="fa fa-plus"></i>
                        新增卡bin</a>
                <% end %>
                <button type="button" class="btn btn-info" data-toggle="modal" data-target="#search_form_modal">
                    <i class="fa fa-search-plus"></i> 查找卡bin
                </button>
            </div>
            <!-- /.panel-heading -->
            <div class="panel-body">
                <div class="row">
                    <%= render partial: 'shared/index_table_entries_info', locals: {collection: @bank_card_bins, model: 'card_bin'} %>
                </div>
                <br>

                <div class="table-responsive">
                    <table class="table table-striped table-bordered table-hover">
                        <thead>
                        <tr>
                            <th>银行代码</th>
                            <th>银行名称</th>
                            <th>卡号长度</th>
                            <th>卡BIN</th>
                            <th>银联卡标识</th>
                            <th>信用卡标识</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <%= render partial: 'card_bin', collection: @bank_card_bins, as: :card_bin %>
                        </tbody>
                    </table>
                </div>
                <!-- /.table-responsive -->
                <div class="row">
                    <%= render partial: 'shared/index_table_entries_info', locals: {collection: @bank_card_bins, model: 'card_bin'} %>
                </div>
            </div>
            <!-- /.panel-body -->
        </div>
        <!-- /.panel -->
    </div>
    <!-- /.col-lg-12 -->
</div>

